3.24 \(\int \sqrt{a+b \cot ^2(x)} \tan ^2(x) \, dx\)

Optimal. Leaf size=51 \[ \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )+\tan (x) \sqrt{a+b \cot ^2(x)} \]

[Out]

Sqrt[a - b]*ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]] + Sqrt[a + b*Cot[x]^2]*Tan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.088678, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.294, Rules used = {3670, 475, 12, 377, 203} \[ \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )+\tan (x) \sqrt{a+b \cot ^2(x)} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b*Cot[x]^2]*Tan[x]^2,x]

[Out]

Sqrt[a - b]*ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]] + Sqrt[a + b*Cot[x]^2]*Tan[x]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 475

Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[((e*x)^(m
 + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q)/(a*e*(m + 1)), x] - Dist[1/(a*e^n*(m + 1)), Int[(e*x)^(m + n)*(a + b*
x^n)^p*(c + d*x^n)^(q - 1)*Simp[c*b*(m + 1) + n*(b*c*(p + 1) + a*d*q) + d*(b*(m + 1) + b*n*(p + q + 1))*x^n, x
], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[0, q, 1] && LtQ[m, -1] &&
IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 377

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{a+b \cot ^2(x)} \tan ^2(x) \, dx &=-\operatorname{Subst}\left (\int \frac{\sqrt{a+b x^2}}{x^2 \left (1+x^2\right )} \, dx,x,\cot (x)\right )\\ &=\sqrt{a+b \cot ^2(x)} \tan (x)-\operatorname{Subst}\left (\int \frac{-a+b}{\left (1+x^2\right ) \sqrt{a+b x^2}} \, dx,x,\cot (x)\right )\\ &=\sqrt{a+b \cot ^2(x)} \tan (x)-(-a+b) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right ) \sqrt{a+b x^2}} \, dx,x,\cot (x)\right )\\ &=\sqrt{a+b \cot ^2(x)} \tan (x)-(-a+b) \operatorname{Subst}\left (\int \frac{1}{1-(-a+b) x^2} \, dx,x,\frac{\cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )\\ &=\sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )+\sqrt{a+b \cot ^2(x)} \tan (x)\\ \end{align*}

Mathematica [C]  time = 0.0867389, size = 44, normalized size = 0.86 \[ \tan (x) \sqrt{a+b \cot ^2(x)} \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\frac{(a-b) \cot ^2(x)}{a+b \cot ^2(x)}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b*Cot[x]^2]*Tan[x]^2,x]

[Out]

Sqrt[a + b*Cot[x]^2]*Hypergeometric2F1[-1/2, 1, 1/2, -(((a - b)*Cot[x]^2)/(a + b*Cot[x]^2))]*Tan[x]

________________________________________________________________________________________

Maple [B]  time = 0.219, size = 750, normalized size = 14.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cot(x)^2)^(1/2)*tan(x)^2,x)

[Out]

-1/2*4^(1/2)/b^(1/2)/(-a+b)^(1/2)*(-1+cos(x))*(-cos(x)*ln(4*cos(x)*(-a+b)^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(c
os(x)+1)^2)^(1/2)-4*a*cos(x)+4*b*cos(x)+4*(-a+b)^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2))*b^(3/2
)+cos(x)*(-a+b)^(1/2)*b^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)-cos(x)*ln(-4/b^(1/2)*(-1+cos(x))
*(cos(x)*b^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)
/(cos(x)+1)^2)^(1/2)*b^(1/2)+a)/sin(x)^2)*(-a+b)^(1/2)*a+cos(x)*ln(-4/b^(1/2)*(-1+cos(x))*(cos(x)*b^(1/2)*(-(c
os(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*
b^(1/2)+a)/sin(x)^2)*(-a+b)^(1/2)*b+cos(x)*ln(-2/b^(1/2)*(-1+cos(x))*(cos(x)*b^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-
a)/(cos(x)+1)^2)^(1/2)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/2)+a)/sin(x)^2)*
(-a+b)^(1/2)*a-cos(x)*ln(-2/b^(1/2)*(-1+cos(x))*(cos(x)*b^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2
)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/2)+a)/sin(x)^2)*(-a+b)^(1/2)*b+cos(x)
*ln(4*cos(x)*(-a+b)^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)-4*a*cos(x)+4*b*cos(x)+4*(-a+b)^(1/2)
*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2))*b^(1/2)*a+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^
(1/2)*(-a+b)^(1/2))*((cos(x)^2*a-b*cos(x)^2-a)/(cos(x)^2-1))^(1/2)/cos(x)/sin(x)/(-(cos(x)^2*a-b*cos(x)^2-a)/(
cos(x)+1)^2)^(1/2)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{b \cot \left (x\right )^{2} + a} \tan \left (x\right )^{2}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)^2)^(1/2)*tan(x)^2,x, algorithm="maxima")

[Out]

integrate(sqrt(b*cot(x)^2 + a)*tan(x)^2, x)

________________________________________________________________________________________

Fricas [A]  time = 2.09976, size = 521, normalized size = 10.22 \begin{align*} \left [\frac{1}{4} \, \sqrt{-a + b} \log \left (-\frac{a^{2} \tan \left (x\right )^{4} - 2 \,{\left (3 \, a^{2} - 4 \, a b\right )} \tan \left (x\right )^{2} + a^{2} - 8 \, a b + 8 \, b^{2} - 4 \,{\left (a \tan \left (x\right )^{3} -{\left (a - 2 \, b\right )} \tan \left (x\right )\right )} \sqrt{-a + b} \sqrt{\frac{a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{\tan \left (x\right )^{4} + 2 \, \tan \left (x\right )^{2} + 1}\right ) + \sqrt{\frac{a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right ), \frac{1}{2} \, \sqrt{a - b} \arctan \left (\frac{2 \, \sqrt{a - b} \sqrt{\frac{a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )}{a \tan \left (x\right )^{2} - a + 2 \, b}\right ) + \sqrt{\frac{a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)^2)^(1/2)*tan(x)^2,x, algorithm="fricas")

[Out]

[1/4*sqrt(-a + b)*log(-(a^2*tan(x)^4 - 2*(3*a^2 - 4*a*b)*tan(x)^2 + a^2 - 8*a*b + 8*b^2 - 4*(a*tan(x)^3 - (a -
 2*b)*tan(x))*sqrt(-a + b)*sqrt((a*tan(x)^2 + b)/tan(x)^2))/(tan(x)^4 + 2*tan(x)^2 + 1)) + sqrt((a*tan(x)^2 +
b)/tan(x)^2)*tan(x), 1/2*sqrt(a - b)*arctan(2*sqrt(a - b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)/(a*tan(x)^2 -
 a + 2*b)) + sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a + b \cot ^{2}{\left (x \right )}} \tan ^{2}{\left (x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)**2)**(1/2)*tan(x)**2,x)

[Out]

Integral(sqrt(a + b*cot(x)**2)*tan(x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.54874, size = 323, normalized size = 6.33 \begin{align*} \frac{1}{2} \,{\left (\sqrt{-a + b} \log \left ({\left (\sqrt{-a + b} \cos \left (x\right ) - \sqrt{-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2}\right ) - \frac{4 \, a \sqrt{-a + b}}{{\left (\sqrt{-a + b} \cos \left (x\right ) - \sqrt{-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} - a}\right )} \mathrm{sgn}\left (\sin \left (x\right )\right ) - \frac{{\left (a \sqrt{-a + b} \log \left (-a - 2 \, \sqrt{-a + b} \sqrt{b} + 2 \, b\right ) - a \sqrt{b} \log \left (-a - 2 \, \sqrt{-a + b} \sqrt{b} + 2 \, b\right ) - \sqrt{-a + b} b \log \left (-a - 2 \, \sqrt{-a + b} \sqrt{b} + 2 \, b\right ) + b^{\frac{3}{2}} \log \left (-a - 2 \, \sqrt{-a + b} \sqrt{b} + 2 \, b\right ) + 2 \, a \sqrt{-a + b}\right )} \mathrm{sgn}\left (\sin \left (x\right )\right )}{2 \,{\left (a + \sqrt{-a + b} \sqrt{b} - b\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)^2)^(1/2)*tan(x)^2,x, algorithm="giac")

[Out]

1/2*(sqrt(-a + b)*log((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a))^2) - 4*a*sqrt(-a + b)/((sqrt(
-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a))^2 - a))*sgn(sin(x)) - 1/2*(a*sqrt(-a + b)*log(-a - 2*sqrt
(-a + b)*sqrt(b) + 2*b) - a*sqrt(b)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) - sqrt(-a + b)*b*log(-a - 2*sqrt(-a
 + b)*sqrt(b) + 2*b) + b^(3/2)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + 2*a*sqrt(-a + b))*sgn(sin(x))/(a + sqr
t(-a + b)*sqrt(b) - b)